import mockjs from 'mockjs';
import { delay } from 'roadhog-api-doc';
import defaultSettings from '../src/defaultSettings';

const proxy = {
  // 'GET /orgauth/SystemInfoController/getSysCodeBySysNbr.do': (req, res) => {
  //   const { query } = req;
  //   if (query.sysNbr === 'APP0') {
  //     res.send('727004');
  //   } else if (query.sysNbr === 'RWGL') {
  //     res.send('727007');
  //   }
  // },

  // 菜单按字母分类
  'GET /orgauth/FuncMenuController/selectMenuByLetter.do': (req, res) => {
    res.send([]);
  },
  // 收藏菜单
  'GET /orgauth/SysuserCollectionController/getCollectionMenu.do': (req, res) => {
    res.send([]);
  },
  // 最近访问的菜单
  'GET /orgauth/SysuserRecentMenuController/getRecentMenuInfo.do': (req, res) => {
    res.send([]);
  },
  //
  'GET /orgauth/FuncMenuController/selectMenuFromSession.do': (req, res) => {
    res.status(200).send([
      {
        menuId: 5240502,
        menuName: '页面样例-react',
        menuLevel: 0,
        // 菜单类型, 1000：目录菜单，1100：叶子菜单
        menuType: '1000',
        menuTypeName: '目录菜单',
        // 父节点menuid。0表示根节点
        parMenuId: 0,
        // 菜单排序
        menuIndex: 0,
        menuDesc: 'REACT',
        urlAddr: 'Views',
        statusCd: '1000',
        firstLetter: 'YMYLREACT',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_YMYLREACT',
        // 打开方式 1：工作台标签页；2:弹窗窗口; 3:新开浏览器; 4: 浏览器新标签
        menuOpenMode: '1',
        // 加密方式 1000:不加密  1001：MD5加密
        paramEncryptType: '1000',
      },
      {
        menuId: 524050211,
        menuName: '表单设计器',
        menuLevel: 1,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 5240502,
        menuIndex: 1,
        menuDesc: '工作台管理',
        statusCd: '1000',
        firstLetter: 'GZTPZ',
        urlAddr: '/formDesigner',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_GZTPZ',
        ifMain: false,
      },
      {
        menuId: 524050212,
        menuName: '表单设计器-详情',
        menuLevel: 1,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 5240502,
        menuIndex: 1,
        menuDesc: '工作台管理',
        statusCd: '1000',
        firstLetter: 'GZTPZ',
        urlAddr: '/formDesigner/templates/flow',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_GZTPZflow',
        ifMain: false,
      },
      {
        menuId: 524050212,
        menuName: 'dnd demo',
        menuLevel: 1,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 5240502,
        menuIndex: 1,
        menuDesc: '工作台管理',
        statusCd: '1000',
        firstLetter: 'GZTPZ2',
        urlAddr: '/formDesigner/index33',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_GZTPZ',
        ifMain: false,
      },
      {
        menuId: 52780365,
        menuName: 'Demo布局案列',
        menuLevel: 1,
        menuType: '1000',
        menuTypeName: '目录菜单',
        parMenuId: 5240502,
        menuIndex: 1,
        menuDesc: '',
        statusCd: '1000',
        firstLetter: 'GSHJH',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_GSHJH',
        ifMain: false,
      },
      {
        privId: 5992005,
        menuId: 52780366,
        menuName: '左右布局滚动条',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 52780365,
        menuIndex: 1,
        urlAddr: '/Demo/LeftRightLayout',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'SDSDSD',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_SDSDSD',
      },
      {
        privId: 5992006,
        menuId: 52780367,
        menuName: '左中右布局',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 52780365,
        menuIndex: 1,
        urlAddr: '/Demo/LeftCenterRightLayout',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'SDSDSD22',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_SDSDSD22',
      },
      // 流程配置
      {
        menuId: 2780364,
        menuName: '流程配置',
        menuLevel: 0,
        menuType: '1000',
        menuTypeName: '目录菜单',
        parMenuId: 0,
        menuIndex: 1,
        menuDesc: '流程配置',
        statusCd: '1000',
        firstLetter: 'XTGLREACT',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_XTGL_REACT',
        ifMain: false,
      },
      {
        menuId: 12780365,
        menuName: '基础管理',
        menuLevel: 1,
        menuType: '1000',
        menuTypeName: '目录菜单',
        parMenuId: 2780364,
        menuIndex: 1,
        menuDesc: '基础管理',
        statusCd: '1000',
        firstLetter: 'GZTPZ',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_GZTPZ',
        ifMain: false,
      },
      // {
      //   privId: 992005,
      //   menuId: 22780366,
      //   menuName: '规则配置管理',
      //   menuLevel: 2,
      //   menuType: '1100',
      //   menuTypeName: '叶子菜单',
      //   parMenuId: 12780365,
      //   menuIndex: 1,
      //   urlAddr: '/basicManage/ruleConfig',
      //   systemCode: '727001',
      //   statusCd: '1000',
      //   firstLetter: 'YHMBPZ',
      //   iconUrl: 'icon-gene-man-manager',
      //   paramEncryptType: '1000',
      //   menuOpenMode: '1',
      //   menuCode: 'TYMH_MENU_YHMBPZ',
      // },
      {
        privId: 992088,
        menuId: 22780388,
        menuName: '规则配置管理',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 12780365,
        menuIndex: 1,
        urlAddr: '/basicManage/ruleConfig2',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'YHHJUSD',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_YJIHPZ',
      },
      {
        privId: 992015,
        menuId: 22780315,
        menuName: '流程配置管理',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 12780365,
        menuIndex: 1,
        urlAddr: '/basicManage/flowConfig',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'YXABPZ',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_YAMBPZ',
      },
      {
        privId: 992015,
        menuId: 22780317,
        menuName: '规则组件管理',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 12780365,
        menuIndex: 1,
        urlAddr: '/configManage/assemblyConfig',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'YXABPZ',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_YAMBPZ',
      },
      {
        privId: 992015,
        menuId: 22780318,
        menuName: '系统参数配置',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 12780365,
        menuIndex: 1,
        urlAddr: '/configManage/paramsConfig',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'YXABPZ',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_YAMBPZ',
      },
      {
        menuId: 12780366,
        menuName: '异常单管理',
        menuLevel: 1,
        menuType: '1000',
        menuTypeName: '目录菜单',
        parMenuId: 2780364,
        menuIndex: 1,
        menuDesc: '异常单管理',
        statusCd: '1000',
        firstLetter: 'GZTPZ',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_GZTPSSZ',
        ifMain: false,
      },
      {
        privId: 99211006,
        menuId: 22780322,
        menuName: '异常工单管理',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 12780366,
        menuIndex: 1,
        urlAddr: '/abnormalManage/abnormalOrder',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'SXSGFDDD',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_SSMXBPZ',
      },
      {
        privId: 99211007,
        menuId: 22780327,
        menuName: '异常配置管理',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 12780366,
        menuIndex: 1,
        urlAddr: '/abnormalManage/abnormalConfig',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'SXSGFASDD',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_SSEEDPZ',
      },
      {
        menuId: 12770367,
        menuName: '流程实例管理',
        menuLevel: 1,
        menuType: '1000',
        menuTypeName: '目录菜单',
        parMenuId: 2780364,
        menuIndex: 1,
        menuDesc: '工单管理',
        statusCd: '1000',
        firstLetter: 'GZTSXPZ',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENUX_ORDER_WORK',
        ifMain: false,
      },
      {
        privId: 99211043,
        menuId: 22780112,
        menuName: '流程实例管理',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 12770367,
        menuIndex: 1,
        urlAddr: '/workordmanage/orderwork',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'SXSASDDD',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_ORDER_WORK_ONE',
      },
      {
        menuId: 12780367,
        menuName: '工单管理',
        menuLevel: 1,
        menuType: '1000',
        menuTypeName: '目录菜单',
        parMenuId: 2780364,
        menuIndex: 1,
        menuDesc: '工单管理',
        statusCd: '1000',
        firstLetter: 'GZTSXPZ',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENUX_GZTPSSZ',
        ifMain: false,
      },
      {
        privId: 99211043,
        menuId: 22780112,
        menuName: '我的任务单',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 12780367,
        menuIndex: 1,
        urlAddr: '/workordmanage/myworkord',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'SXSASDDD',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_XSBPZ',
      },
      {
        menuId: 127822367,
        menuName: '订单管理',
        menuLevel: 1,
        menuType: '1000',
        menuTypeName: '目录菜单',
        parMenuId: 2780364,
        menuIndex: 1,
        menuDesc: '订单管理',
        statusCd: '1000',
        firstLetter: 'GQWSXPZ',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MEUX_GZTPSSZ',
        ifMain: false,
      },
      {
        privId: 99435043,
        menuId: 263780112,
        menuName: '工号池管理',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 127822367,
        menuIndex: 1,
        urlAddr: '/ordermanage/numpoolmanage',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'GHZSDDD',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MHHENU_XSBPZ',
      },
      {
        menuId: 300001,
        menuName: '表单管理',
        menuLevel: 0,
        menuType: '1000',
        menuTypeName: '目录菜单',
        parMenuId: 0,
        menuIndex: 1,
        menuDesc: '表单管理',
        statusCd: '1000',
        firstLetter: 'XTGLREACT',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_XTGL_REACT',
        ifMain: false,
      },
      {
        menuId: 310001,
        menuName: '表单管理',
        menuLevel: 1,
        menuType: '1000',
        menuTypeName: '目录菜单',
        parMenuId: 300001,
        menuIndex: 6,
        urlAddr: 'modules/menu/views/MenuManagementView',
        statusCd: '1000',
        firstLetter: 'ZZGL',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_ZZGL',
        ifMain: false,
      },
      {
        privId: 311001,
        menuId: 3110011,
        menuName: '表单管理',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 310001,
        menuIndex: 1,
        urlAddr: '/form/formManage',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'YGGL',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_YGGL',
      },
      {
        menuId: 310002,
        menuName: '环节处理组件',
        menuLevel: 1,
        menuType: '1000',
        menuTypeName: '目录菜单',
        parMenuId: 300001,
        menuIndex: 6,
        urlAddr: 'modules/menu/views/MenuManagementView',
        statusCd: '1000',
        firstLetter: 'ZZGL',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_ZZGL',
        ifMain: false,
      },
      {
        privId: 311002,
        menuId: 3110021,
        menuName: '环节处理对象模板',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 310002,
        menuIndex: 2,
        urlAddr: '/flowComp/ObjTemplate',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'YGGL',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_YGGL',
      },
      {
        privId: 311002,
        menuId: 3110022,
        menuName: '流程导向',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 310002,
        menuIndex: 2,
        urlAddr: '/flowComp/ObjFlowView',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'YGGL',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_YGGL',
      },
      {
        menuId: 3110023,
        menuName: '流程处理记录',
        menuLevel: 1,
        menuType: '1000',
        menuTypeName: '目录菜单',
        parMenuId: 310002,
        menuIndex: 6,
        urlAddr: '/flowComp/processRecords',
        statusCd: '1000',
        firstLetter: 'ZZGL',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_ZZGL',
        ifMain: false,
      },
      {
        menuId: 800001,
        menuName: '扩展配置管理-react',
        menuLevel: 0,
        menuType: '1000',
        menuTypeName: '目录菜单',
        parMenuId: 0,
        menuIndex: 1,
        menuDesc: '系统管理-react',
        statusCd: '1000',
        firstLetter: 'XTGLREACT',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_XTGL_REACT',
        ifMain: false,
      },
      {
        menuId: 810001,
        menuName: '扩展配置管理',
        menuLevel: 1,
        menuType: '1000',
        menuTypeName: '目录菜单',
        parMenuId: 800001,
        menuIndex: 6,
        urlAddr: 'modules/menu/views/MenuExtendConfig',
        statusCd: '1000',
        firstLetter: 'ZZGL',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_ZZGL',
        ifMain: false,
      },
      {
        privId: 811001,
        menuId: 8110011,
        menuName: '流程扩展配置',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 810001,
        menuIndex: 1,
        urlAddr: '/flowExtendConfig',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'YGGL',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_YGGL',
      },
      {
        privId: 811002,
        menuId: 8110021,
        menuName: '环节扩展配置',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 810001,
        menuIndex: 1,
        urlAddr: '/flowTacheConfig',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'YGGL',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_YGGL',
      },
      {
        menuId: 900001,
        menuName: '业务对象管理-react',
        menuLevel: 0,
        menuType: '1000',
        menuTypeName: '目录菜单',
        parMenuId: 0,
        menuIndex: 1,
        menuDesc: '业务对象管理-react',
        statusCd: '1000',
        firstLetter: 'XTGLREACT',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_XTGL_REACT',
        ifMain: false,
      },
      {
        menuId: 910001,
        menuName: '业务对象管理',
        menuLevel: 1,
        menuType: '1000',
        menuTypeName: '目录菜单',
        parMenuId: 900001,
        menuIndex: 6,
        urlAddr: 'modules/menu/views/MenuBusiObjManage',
        statusCd: '1000',
        firstLetter: 'ZZGL',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_ZZGL',
        ifMain: false,
      },
      {
        privId: 911001,
        menuId: 9110011,
        menuName: '业务对象管理',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 910001,
        menuIndex: 1,
        urlAddr: '/busiObjManage',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'YGGL',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_YGGL',
      },
      {
        privId: 911002,
        menuId: 9110012,
        menuName: '业务组件管理',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 910001,
        menuIndex: 2,
        urlAddr: '/busiComponent',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'YGGL',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_YGGL',
      },
      {
        privId: 911003,
        menuId: 9110013,
        menuName: '个性化组件管理',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 910001,
        menuIndex: 2,
        urlAddr: '/componentManage',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'YGGL',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_YGGL',
      },
      {
        menuId: 700001,
        menuName: '功能开发及配置需求',
        menuLevel: 0,
        menuType: '1000',
        menuTypeName: '目录菜单',
        parMenuId: 0,
        menuIndex: 4,
        menuDesc: '功能开发及配置需求',
        statusCd: '1000',
        firstLetter: 'XTGLREACT',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_XTGL_REACT',
        ifMain: false,
      },
      {
        menuId: 710001,
        menuName: '功能开发及配置需求',
        menuLevel: 1,
        menuType: '1000',
        menuTypeName: '目录菜单',
        parMenuId: 700001,
        menuIndex: 1,
        urlAddr: 'modules/menu/views/MenuFormFunctionConf',
        statusCd: '1000',
        firstLetter: 'ZZGL',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_ZZGL',
        ifMain: false,
      },
      {
        privId: 711001,
        menuId: 7110011,
        menuName: '功能开发及配置需求',
        menuLevel: 2,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 710001,
        menuIndex: 1,
        urlAddr: '/formFunctionConf',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'YGGL',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_YGGL',
      },
    ]);
  },
  // 收藏菜单接口
  'post /orgauth/SysuserRecentMenuController/updateCollectionMenu.do': (req, res) => {
    res.status(200).send({
      resultCode: '0',
      resultObject: {},
    });
  },

  // 菜单标签打开历史记录接口
  // 'put /orgauth/SysuserRecentMenuController/updateRecentMenu.do':(req, res) => {
  //   res.status(200).send(1);
  // },
};

export default delay(proxy, defaultSettings.delay);
